<div class="header"> 
    <h1 class="page-header">
        产品管理
    </h1>
    <ol class="breadcrumb">
        <li><a href="#">首页</a></li>
        <li><a href="{:U('Goods/index')}">产品列表</a></li>
        <li class="active"><a href="#">修改产品</a></li>
    </ol> 

</div>
<div id="page-inner">
    <!-- 内容开始 -->
    <div class="row">

        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                修改产品
                </div> 
                <div class="panel-body"> 
                  <form class="form-horizontal" action="{:U('Goods/editCourse')}" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="id" value="{$res.id}">
                    <div class="form-group">
                      <label class="col-sm-2 control-label">产品名</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="name" placeholder="产品名" value="{$res.name}">
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">产品类型</label>
                      <div class="col-sm-10">
                        <select name="typeid" class="form-control">
                          <?php foreach($goodstypeList as $i=>$v){?>
                          <option value="<?php echo $v['id'];?>" <?php if($v['id']==$res['typeid']){ echo 'selected="selected"';}?> ><?php echo $v['typename'];?></option>
                          <?php } ?>
                        </select>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">价格</label>
                      <div class="col-sm-10">
                        <input type="number" class="form-control" name="price" placeholder="价格" value="{$res.price}">
                      </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">上传主图</label>
                        <div class="col-sm-10">
                          <input type="file" name="mainimg">
                          <p class="help-block">上传图片小于2M（格式为jpg, gif, png, jpeg）</p>
                        </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">是否是新品</label>
                      <div class="col-sm-10">
                        <label class="radio-inline">
                          <input type="radio" name="isnew" value="1" <?php if($res['isnew']==1){ echo 'checked="checked"';}?>>是
                        </label>
                        <label class="radio-inline">
                          <input type="radio" name="isnew" value="0" <?php if($res['isnew']==0){ echo 'checked="checked"';}?>>否
                        </label>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">是否是促销商品</label>
                      <div class="col-sm-10">
                        <label class="radio-inline">
                          <input type="radio" name="ispromotion" value="1" <?php if($res['ispromotion']==1){ echo 'checked="checked"';}?>>是
                        </label>
                        <label class="radio-inline">
                          <input type="radio" name="ispromotion" value="0" <?php if($res['ispromotion']==0){ echo 'checked="checked"';}?>>否
                        </label>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">是否是热销</label>
                      <div class="col-sm-10">
                        <label class="radio-inline">
                          <input type="radio" name="ishot" value="1"  <?php if($res['ishot']==1){ echo 'checked="checked"';}?>>是
                        </label>
                        <label class="radio-inline">
                          <input type="radio" name="ishot" value="0" <?php if($res['ishot']==0){ echo 'checked="checked"';}?>>否
                        </label>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">产品简介</label>
                      <div class="col-sm-10">
                        <textarea id="editor_id" name="introduce" >
                          {$res.introduce}
                        </textarea>
                      </div>
                    </div>
                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">修改</button>
                      </div>
                    </div>
                  </form>  
                </div>
            </div>
        </div>                      
    </div>
    <!-- 内容结束 -->

</div>
<!-- /. PAGE INNER  -->
<script charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh-CN.js"></script>
<script>
  KindEditor.ready(function(K) {
    window.editor = K.create('#editor_id');
  });
</script>
  